import { createFeatureSelector, createSelector } from "@ngrx/store";
import { UserState } from "../reducers";


export const getUserState = createFeatureSelector<UserState>('user');

export const getUserToken = createSelector(getUserState, (state: UserState) => state.token);

export const getUserInfo = createSelector(getUserState, (state: UserState) => state.info);

export const getUserLogined = createSelector(getUserState, (state: UserState) => state.logined);

export const getUserLogining = createSelector(getUserState, (state: UserState) => state.logining);

export const getUserLoginError = createSelector(getUserState, (state: UserState) => state.loginError);

export const getUserLoaded = createSelector(getUserState, (state: UserState) => state.userLoaded);

export const getUserLoading = createSelector(getUserState, (state: UserState) => state.userLoading);

export const getUserLoadError = createSelector(getUserState, (state: UserState) => state.userLoadError);

export const getUserLogouted = createSelector(getUserState, (state: UserState) => state.logouted);

export const getUserLogouting = createSelector(getUserState, (state: UserState) => state.logouting);

export const getUserLogoutError = createSelector(getUserState, (state: UserState) => state.logoutError);
